<?php

/**
 * BonLivraisonClient filter form base class.
 *
 * @package    SdCommerce
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseBonLivraisonClientFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'date'                 => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'reference'            => new sfWidgetFormFilterInput(),
      'reference_annee'      => new sfWidgetFormFilterInput(),
      'lieu_livraison'       => new sfWidgetFormFilterInput(),
      'observation'          => new sfWidgetFormFilterInput(),
      'taux_remise'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_ht'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_remise'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_tva'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_ttc'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rest'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'date_livraison'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'date_validite'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'duree_validite'       => new sfWidgetFormFilterInput(),
      'unite_duree_validate' => new sfWidgetFormFilterInput(),
      'cloture'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'livrer'               => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'domaine'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'mode_paiement_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ModeReglement'), 'add_empty' => true)),
      'departement_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'add_empty' => true)),
      'representant_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Representant'), 'add_empty' => true)),
      'taux_escompte'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'confirme'             => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'valider'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'affaire_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Affaire'), 'add_empty' => true)),
      'client_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Client'), 'add_empty' => true)),
      'brouillon'            => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'total_fodec'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'journal_caisse'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'statut'               => new sfWidgetFormChoice(array('choices' => array('' => '', 'Reglé' => 'Reglé', 'Non Reglé' => 'Non Reglé', 'Partiellement Reglé' => 'Partiellement Reglé'))),
      'facture_client_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FactureClient'), 'add_empty' => true)),
      'is_bon_commande'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'categorie_remise_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CategorieRemise'), 'add_empty' => true)),
      'created_at'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'deleted_at'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'date'                 => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'reference'            => new sfValidatorPass(array('required' => false)),
      'reference_annee'      => new sfValidatorPass(array('required' => false)),
      'lieu_livraison'       => new sfValidatorPass(array('required' => false)),
      'observation'          => new sfValidatorPass(array('required' => false)),
      'taux_remise'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_ht'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_remise'         => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_tva'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_ttc'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'rest'                 => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'date_livraison'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'date_validite'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'duree_validite'       => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'unite_duree_validate' => new sfValidatorPass(array('required' => false)),
      'cloture'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'livrer'               => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'domaine'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'mode_paiement_id'     => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ModeReglement'), 'column' => 'id')),
      'departement_id'       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Departement'), 'column' => 'id')),
      'representant_id'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Representant'), 'column' => 'id')),
      'taux_escompte'        => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'confirme'             => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'valider'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'affaire_id'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Affaire'), 'column' => 'id')),
      'client_id'            => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Client'), 'column' => 'id')),
      'brouillon'            => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'total_fodec'          => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'journal_caisse'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'statut'               => new sfValidatorChoice(array('required' => false, 'choices' => array('Reglé' => 'Reglé', 'Non Reglé' => 'Non Reglé', 'Partiellement Reglé' => 'Partiellement Reglé'))),
      'facture_client_id'    => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('FactureClient'), 'column' => 'id')),
      'is_bon_commande'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'categorie_remise_id'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('CategorieRemise'), 'column' => 'id')),
      'created_at'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'deleted_at'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('bon_livraison_client_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'BonLivraisonClient';
  }

  public function getFields()
  {
    return array(
      'id'                   => 'Number',
      'date'                 => 'Date',
      'reference'            => 'Text',
      'reference_annee'      => 'Text',
      'lieu_livraison'       => 'Text',
      'observation'          => 'Text',
      'taux_remise'          => 'Number',
      'total_ht'             => 'Number',
      'total_remise'         => 'Number',
      'total_tva'            => 'Number',
      'total_ttc'            => 'Number',
      'rest'                 => 'Number',
      'date_livraison'       => 'Date',
      'date_validite'        => 'Date',
      'duree_validite'       => 'Number',
      'unite_duree_validate' => 'Text',
      'cloture'              => 'Boolean',
      'livrer'               => 'Boolean',
      'domaine'              => 'Boolean',
      'mode_paiement_id'     => 'ForeignKey',
      'departement_id'       => 'ForeignKey',
      'representant_id'      => 'ForeignKey',
      'taux_escompte'        => 'Number',
      'confirme'             => 'Boolean',
      'valider'              => 'Boolean',
      'affaire_id'           => 'ForeignKey',
      'client_id'            => 'ForeignKey',
      'brouillon'            => 'Boolean',
      'total_fodec'          => 'Number',
      'journal_caisse'       => 'Boolean',
      'statut'               => 'Enum',
      'facture_client_id'    => 'ForeignKey',
      'is_bon_commande'      => 'Boolean',
      'categorie_remise_id'  => 'ForeignKey',
      'created_at'           => 'Date',
      'updated_at'           => 'Date',
      'deleted_at'           => 'Date',
    );
  }
}
